<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>P93 【例5-1】demo01.html</title>
</head>

<body>
    <input id="k" type="text" value="name">
    <input id="v" type="text" value="Jack">
    <input id="btn" type="button" value="text">
    <script>
        var k = document.getElementById('k');
        var v = document.getElementById('v');
        var btn = document.getElementById('btn');
        var o = {};
        btn.onclick = function () {
            o[k.value] = v.value;
            console.log(o);
        }
    </script>
    <a href="../首页/page05.html">
        <h2>返回上一页面</h2>
    </a>
</body>

</html>